 {

        var o = require("../../UIManager/UISoundManager.js");
        cc.Class({
            extends: cc.Component,
            properties: {},
            onLoad: function () {
                Global.notificationCenter.on(Global.eventName.GAME_TASKS, this.onGameTasks.bind(this), this);
            },
            start: function () {
            },
            onGameTasks: function (e) {
                if (Global.utils.hideWaitting(), null != e && null != e.tasks) for (var t = this, n = 0; n < e.tasks.length; n++) {
                    var i = e.tasks[n];
                    if ("pop_tip" == i.action) {
                        var a = i.params;
                        Global.utils.showNodeCommon(a.text, a.duration);
                        var r = Global.config.QueryTag.inviteToFriRoom;
                        Global.query && Global.query.extraInfo && Global.query.extraInfo[r] && (Global.query.extraInfo[r] = null);
                    } else if ("pop_order_info" == i.action) ; else if ("pop_info_wnd" == i.action) {
                        var s = (a = i.params).sub_action.params.roomId || Global.roomInfoModel.getRecommendRoomId(),
                            l = {
                                text: a.des,
                                confirmText: "确定",
                                confirmSp: Global.spriteAtlas.getOKSpf(),
                                cancelText: "取消",
                                cancelSp: Global.spriteAtlas.getCancelSpf(),
                                confirmCallback: function () {
                                    o.playEffect("select"), t.doQuickStart(s);
                                },
                                cancelCallback: function () {
                                    o.playEffect("select");
                                }
                            };
                        Global.UIPopupManager.alert(l);
                    } else if ("daily_free_give" == i.action) {
                        console.error("没钱了，发的消息是 daily_free_give");
                        var c = i.params.dailyFreeGiveCountLeft || 0;
                        i.params.dailyFreeGiveAmount, i.params.dailyFreeGiveMaxCount;
                        if (c > 0) if (Global.tableModel.isInGameScene()) if (console.log("在游戏中"), Global.tableModel.getIsGameEnd()) {
                            var d = (u = Global.tableModel.getPlayerModel(Global.config.SEAT_DOWN)).getLosePaybackCount();
                            console.log("游戏结束，检查系统包赔次数", d), 0 == d ? (console.log("游戏结束，系统包赔次数为0, 弹出转运礼包"),
                                Global.utils.showRedPacketWinLucky()) : Global.tableModel.getAllowPopupRotateLuckInGameEnd() && (console.log("游戏结束，系统包赔次数不为0，点击继续游戏"),
                                Global.utils.showRedPacketWinLucky());
                        } else {
                            if (cc.log("没到游戏结束，弹出转运礼包"), Global.tableModel.getBoolShowRewardRotateLuckLayer()) {
                                Global.utils.showRedPacketWinLucky(!0);
                            } else {
                                var u;
                                (u = Global.tableModel.getPlayerModel(Global.config.SEAT_DOWN)) && Global.tableModel.requestCharge(-1, u.getSeatId()),
                                    Global.utils.showNodeCommon("本局转运红包已经领完，下一把就转运了哦！", 3);
                            }
                        } else console.log("不在游戏中"), Global.utils.showRedPacketWinLucky(); else (c = 0) && Global.utils.showNodeCommon("没有低保次数了。", 2);
                    } else if ("already_in_other_game" == i.action) {
                        var h;
                        (function () {
                            h = Global.utils.parseLocInfo(i.params.loc), Global.tableModel.setHasGameId(h[0]);
                            var e = {
                                text: i.params.des,
                                confirmText: "确定",
                                confirmSp: Global.spriteAtlas.getOKSpf(),
                                cancelText: "取消",
                                cancelSp: Global.spriteAtlas.getCancelSpf(),
                                confirmCallback: function () {
                                    (function () {
                                        var e = Global.tableModel.getHasGameId();
                                        console.log("onGameTasks", e), e && (e.gameId == Global.config.GAMEID_NORMAL ? Global.SetGameId(Global.config.GAMEID_NORMAL) : e.gameId == Global.config.GAMEID_ERREN ? Global.SetGameId(Global.config.GAMEID_ERREN) : e.gameId == Global.config.GAMEID_ERRENQUICK && Global.SetGameId(Global.config.GAMEID_ERRENQUICK));
                                    })();
                                    var e = Global.roomInfoModel.getRecommendRoomId();
                                    if (e < 0) {
                                        cc.error("persistNode onGameTasks roomId<0");
                                        var t = {
                                            text: "金币不足，快去分享获取金币吧！",
                                            cancelSp: Global.spriteAtlas.getGoInviteSpf(),
                                            cancelText: "去邀请",
                                            cancelCallback: function () {
                                                Global.UIPopupManager.addPopup("PopupPanel/Panel_InviteFri", function (e) {
                                                });
                                            },
                                            closeCallback: function () {
                                                console.log("closeCallback");
                                            },
                                            needConfirmBtn: !1
                                        };
                                        Global.UIPopupManager.alert(t);
                                    } else {
                                        Global.roomInfoModel.setRoomId(e);
                                        var n = Global.roomInfoModel.getPlayModel();
                                        Global.msgHandler.requestQuickStart(n, e);
                                    }
                                },
                                cancelCallback: function () {
                                },
                                needCloseBtn: !1
                            };
                            Global.UIPopupManager.alert(e);
                        })();
                    }
                }
            },
            doQuickStart: function (e) {
                if ((e = e || Global.roomInfoModel.getRecommendRoomId()) < 0) {
                    cc.error("TaskPersistManager doQuickStart roomId<0");
                    var t = {
                        text: "金币不足，快去分享获取金币吧！",
                        cancelSp: Global.spriteAtlas.getGoInviteSpf(),
                        cancelText: "去邀请",
                        cancelCallback: function () {
                            Global.UIPopupManager.addPopup("PopupPanel/Panel_InviteFri", function (e) {
                            });
                        },
                        closeCallback: function () {
                            console.log("closeCallback");
                        },
                        needConfirmBtn: !1
                    };
                    Global.UIPopupManager.alert(t);
                } else {
                    Global.roomInfoModel.setRoomId(e);
                    var n = Global.roomInfoModel.getPlayModel();
                    Global.msgHandler.requestQuickStart(n, e);
                }
            },
            onDestroy: function () {
                Global.notificationCenter.offAll(this);
            }
        })
    }